/*
 * *********************************************
 *      BY WURIYANTO
 * EMAIL/FACEBOOK : wuriyanto48@yahoo.co.id  OR  Prince Wuriyanto
 * STATE BANJARNEGARA CENTRAL JAVA INDONESIA
 * INFORMATIC ENGINEERING
 * MUHAMMADIYAH UNIVERSITY OF PURWOKERTO
 * NB:BEBAS DIDISTRIBUSIKAN UNTUK TUJUAN BELAJAR
 */
package com.mobil.database;

import oracle.jdbc.OracleDriver;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author WURY
 */
public class DbConnection {
    private static Connection con;
    private static final String URL = "jdbc:oracle:thin:@localhost:1521:XE";
    private static final String USER = "mobil";
    private static final String PASS = "mobil";
    
    public static Connection getConn(){
        if(con == null){
            try{
                OracleDriver driver = new OracleDriver();
                DriverManager.registerDriver(driver);
                System.out.println("Driver Registered");
                con = DriverManager.getConnection(URL, USER, PASS);
                System.out.println("Database Connection Successfully");
            }catch(SQLException er){
            
            }
        }
        return con;
    }
}
